package com.dsh.vegetable.action;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;


import com.dsh.code.entity.Page;
import com.dsh.vegetable.entity.Vegetable;
import com.dsh.vegetable.manager.VegetableMng;
import com.github.pagehelper.PageInfo;

@Controller
@RequestMapping("/vegetable")
public class VegetableManageAct {
	@RequestMapping("/allVegetable.do")
	public String getAllVegetables(Vegetable bean, HttpServletRequest request,
			Page varpage, Model model) {

		System.out.println(varpage.getPageNum() + "____________________"
				+ varpage.getPageSize());
		PageInfo<Vegetable> page = vegetableMng.getAll();
		model.addAttribute("page", page);
		return "bms/vegetable/list";
	}

	@Resource(name = "vegetableMngImpl")
	private VegetableMng vegetableMng;
	
	
}
